<?php

ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);

require_once  __DIR__ . '/includes/authenticate.php';

include_once __DIR__ . '/db_bb_connect.php';

include __DIR__ . '/mainpage.php';

?>
<?php 

if (isset($_GET['ID'])) 


  { ?>

<div class="container-fluid">

    <div class="row">
      <div class="col-md-4"></div>
      <div class="col-md-4"> 

        <br>
        <a class="btn btn-default btn-sm" href="./articles_archive.php">Back to Archive</a>
        <br>
      
      <?php 

  $setarticleID = $_GET['ID'];

  $sql = "SELECT title, text FROM articles WHERE ID = '$setarticleID'";
  $result = $db->query($sql);
  $row = $result->fetch_assoc();
  $settitle = $row['title'];
  $settext = $row['text']; 

?>
<h2><?= $settitle?></h2>

<?= $settext?>


<br>
</div>
<div class="col-md-4"></div>

      </div>
      
    </div>

<?php }?>

